home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
music4c.sit
/
Music4C Folder
/
Sources Folder
/
ErrorAlert.c
< prev
next >
Wrap
Text File
|
1990-06-08
|
2KB
|
68 lines
/*
* ⌐ Graeme Gerrard 1990
* Faculty of Music, University of Melbourne
* Parkville Victoria 3052 Australia.
*
* ARPANET: grae@murdu.ucs.unimelb.edu.au
* telephone: (613) 344 4127, Fax: (613) 344 5346
*/
#include "Music4C.h"
void OSError(Str1, Str2, theErr)
Str255 Str1, Str2;
OSErr theErr;
{
Str255 Str3;
if (theErr)
NumToString(theErr, &Str3);
ParamText(Str1, Str2, Str3, NIL);
A_ErrorAlert();
}
void A_ErrorAlert()
{
#define I_OK 1
#define I_x 2
#define I_x3 3
#define I_x5 4
short itemHit;
AlertTHndl AlertResHandle;
Rect tempRect;
InitCursor();
AlertResHandle = (AlertTHndl)GetResource('ALRT', ABOUT_DIALOG);
HLock((Handle)AlertResHandle);
tempRect.left = (*AlertResHandle)->boundsRect.left;
tempRect.right = (*AlertResHandle)->boundsRect.right;
tempRect.top = (*AlertResHandle)->boundsRect.top;
tempRect.bottom = (*AlertResHandle)->boundsRect.bottom;
tempRect.top = ((screenBits.bounds.bottom - screenBits.bounds.top) - (tempRect.bottom - tempRect.top)) / 3;
tempRect.left = ((screenBits.bounds.right - screenBits.bounds.left) - (tempRect.right - tempRect.left)) / 2;
tempRect.bottom = tempRect.top + ((*AlertResHandle)->boundsRect.bottom - (*AlertResHandle)->boundsRect.top);
tempRect.right = tempRect.left + ((*AlertResHandle)->boundsRect.right - (*AlertResHandle)->boundsRect.left);
(*AlertResHandle)->boundsRect.left = tempRect.left;
(*AlertResHandle)->boundsRect.right = tempRect.right;
(*AlertResHandle)->boundsRect.top = tempRect.top;
(*AlertResHandle)->boundsRect.bottom = tempRect.bottom;
/* Let the OS handle the Alert and wait for a result to be returned */
itemHit = NoteAlert(4, NIL);
HUnlock((Handle)AlertResHandle);
/* This is a button that may have been pressed. */
if (I_OK == itemHit)
{
/* ?? PLACE YOUR CODE HERE */
}
ExitToShell(); /* we only get here if we got a severe error */
}